package com.github.dengmin.mysql.dao.impl;

import com.github.dengmin.mysql.common.SQL;
import com.github.dengmin.mysql.dao.RoleDao;
import com.github.dengmin.mysql.mapper.RoleMapper;
import com.github.dengmin.mysql.model.Role;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @Author dengmin
 * @Created 2020/8/30 上午10:48
 */
@Repository
public class RoleDaoImpl implements RoleDao {
    private static final long serialVersionUID = 1L;

    @Resource
    private JdbcTemplate jdbcTemplate;

    @Override
    public Role getById(Long id) {
        return jdbcTemplate.queryForObject(SQL.queryRoleById, new RoleMapper(), id);
    }
}
